Drain remaining code-scanning alerts: idna pin, OSV ignores, FFI SAFETY + null-checks#317
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Drains the remaining 21 open code-scanning alerts (12 OSV + 9 CodeQL) left after the
security-hardening(#316) pass. After merge, code-scanning should go to 0 open. OSV-scanner CI run should turn green (was failing on every push to dev because of these).OSV-scanner (12 alerts -> 0)
CVE-2026-45409(2x medium, real CVE): patched inidna >= 3.15. Pinnedidna>=3.15as a direct floor indocs/requirements.txtandpython/quantum-pecos/docs/requirements.txt(it was transitive via mkdocs/sphinx deps).hugr-passes/hugr/tket,fusion-blossom,mwpf -> slp -> structopt -> clap2). Addedosv-scanner.tomlat workspace root +scripts/native_bench/bench_pecos/osv-scanner.tomlwith per-CVE[[IgnoredVulns]]entries -- each records the dependency chain and upstream owner of the fix, not blanket suppressions. Review when bumping hugr/tket, fusion-blossom, or mwpf.CodeQL
rust/access-invalid-pointer(9 alerts -> 0)Audited every site -- 0 real bugs:
#[cfg(test)] mod testswhere the deref is preceded byassert!(!ptr.is_null()). Added one-line// SAFETY:comments at each deref.pecos-foreign/src/discovery.rsinsideif !is_null()branches. Added// SAFETY:comments citing the null-check + plugin protocol.pecos-foreign/src/engine.rs(pecos_engine_process,pecos_engine_reset). Added// SAFETY:comments AND anif engine.is_null() { return -1; }defensive null-check at each FFI entry. This matches the existingpecos_engine_free/pecos_free_outcomesdefensive pattern (closes an existing Chesterton's-fence asymmetry where some FFI entries null-checked and others trusted). Added a#[cfg(test)]module covering the new null-return behaviour (pecos-foreignpreviously had 0 unit tests).Test plan
just lintcleancargo test -p pecos-qis-ffi --lib(89 pass, 0 fail)cargo test -p pecos-foreign --lib(2 pass, 0 fail -- the two new null-return tests)